<%-- 
    Document   : role
    Created on : 2016-7-1, 14:13:07
    Author     : 52461
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../link.jsp"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript" src="${base}/js/jquery-barcode.js"></script>
        <style> 
            /*            * {font-size:12px;font-family:"宋体";}*/
        </style>
    </head>
    <body  ng-app="jyjgManager" ng-controller="jyjgCtrl" style="font-size: 微软雅黑;font-size: 12px;" >

        <div style="width: 180px;height:90px;margin-left: 10px;" ng-repeat="pl in pls">
            <div style="width: 100px;display: inline-block;text-align: center;font-weight: bold;font-size: 12px;">茶房卫生院</div>
            <div id="code{{$index}}" >
                <!--<img src="sample/testqr?data={{pl.BARCODE}}">-->
            </div>
            <div style="margin-left: 10px;">
                <div style="width: 80px;display: inline-block;margin-left: 5px">{{pl.PATIENTNAME}}</div>
                <div style="width: 45px;display: inline-block;float: right;margin-right: 5px;">{{pl.SEX}}</div>
                <div style="width: 40px;display: inline-block;margin-left: 5px;">{{pl.AGE}}</div>
                <div style="width: 120px;display: inline-block;float: right;text-align: right;margin-right: 5px;">{{pl.EXAMINAIM}}</div>
            </div>
            <div>
                <!--                <div style="width: 150px;display: inline-block;">{{pl.CYSJ}}</div>-->
                <!--                <div style="width: 150px;display: inline-block;">{{pl.SECTION}}</div>-->
            </div>
            <div>

            </div>

        </div>

    </body>
</html>
<script>
    angular.module("jyjgManager", [])
            .controller("jyjgCtrl", function ($scope) {

                if (localStorage.pl) {
                    $scope.pls = JSON.parse(localStorage.pl);
                    for (var i in $scope.pls) {
                        var str = $scope.pls[i].CYSJ;
                        var dat = new Date(str);
                        $scope.pls[i].CYSJ = dat.Format("yyMMdd hh:mm");

                    }
                    console.log($scope.pls);
                    setTimeout(function () {
                        for (var i in $scope.pls) {
                            console.log($scope.pls[i].BARCODE+"=="+"#code" + i);
                            $("#code" + i).empty().barcode($scope.pls[i].BARCODE, "code128", {barWidth: 2, barHeight: 40, showHRI: true});
                        }

                    }, 300)

                }

                setTimeout(function () {
                    window.print();
                    window.close();
                }, 1000);


            })

</script>
